<script>
    $(function() {
        $( ".calendario" ).datepicker();
    });

    function selectDiv(){
        if($('#orden option:selected').val()==2){
            $('#divorden').show("slow");
            $('#ord').attr('disabled','');
        }else{
            $('#divorden').hide("slow");
            $('#ord').attr('disabled','disabled');
            $('#ord').attr('value',0);
        }
    }
</script>
<?php
echo $this->Form->create('Contract');
echo $this->Form->hidden("Contract.id", array('label' => 'Fecha de inicio'));
echo $this->Form->hidden("Contract.user_id", array('label' => 'Fecha de inicio'));
?>
<table id="tabla">
    <tbody>
        <tr>
            <td><?php echo $this->Form->input("Contract.numero", array('label' => 'Número de contrato')); ?></td>
            <td><?php echo $this->Form->input("Contract.fecha_inicio", array('label' => 'Fecha de inicio', 'class' => 'calendario', 'type' => 'text')); ?></td>
        </tr>
        <tr>
            <td><?php echo $this->Form->input("Contract.fecha_final", array('label' => 'Fecha finalización', 'class' => 'calendario', 'type' => 'text')); ?></td>
            <td><?php echo $this->Form->input("Contract.fecha", array('label' => 'Fecha publicación', 'class' => 'calendario', 'type' => 'text')); ?></td>
        </tr> 
        <tr> 
            <td><?php echo $this->Form->input("Contract.monto", array('label' => 'Monto')); ?></td>
            <td><?php echo $this->Form->input("Contract.objeto", array('label' => 'Objeto')); ?></td>
        </tr>
        <tr> 
            <td><?php echo $this->Form->input("Contract.registro_presupuestal", array('label' => 'Registro presupuestal')); ?></td>
            <td><?php echo $this->Form->input("Contract.cdp", array('label' => 'CDP')); ?></td>
        </tr>
        <tr> 
            <td><?php echo $this->Form->input("Contract.fecha_cdp", array('label' => 'Fecha CDP', 'class' => 'calendario', 'type' => 'text')); ?></td>
            <td><?php echo $this->Form->input("Contract.dependencia", array('label' => 'Dependencia')); ?></td>
        </tr>
        <tr> 
            <td><?php echo $this->Form->input("Contract.interventor", array('label' => 'Interventor')); ?></td>
            <td><?php echo $this->Form->input("Contract.numero_cuenta", array('label' => 'Número  de cuenta')); ?></td>
        </tr>
        <tr> 
            <td><?php echo $this->Form->input("Contract.banco", array('label' => 'Banco')); ?></td>
            <td><?php echo $this->Form->input("Contract.tipo_cuenta", array('label' => 'Tipo cuenta', 'options' => array('Ahorros' => 'Ahorros', 'Corriente' => 'Corriente'))); ?></td>
        </tr>
    </tbody>
</table>

<?php
echo $this->Ajax->submit('Guardar', array('url' => array('controller' => 'Contracts', 'action' => 'edit', $this->data['Contract']['id']), 'update' => 'content', 'indicator' => 'loading'));
echo $this->Form->end();
?>
<?php echo $this->Ajax->link($this->Html->image("regresar.gif", array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar')), array('controller' => "Contracts", "action" => "index", $this->data['Contract']['user_id']), array('update' => 'content', 'indicator' => 'loading', 'escape' => false), null) ?>
